import React from 'react';
import { Divider as AntdDivider } from 'antd';
import type { DividerProps as AntdDividerProps } from 'antd';
import { createStyles } from 'antd-style';

export interface DividerProps extends AntdDividerProps {
  /**
   * @description 自定义样式类名
   */
  customClassName?: string;
}

const useStyles = createStyles(({ token, css }) => ({
  divider: css`
    border-color: ${token.colorBorder};
  `,
}));

const Divider: React.FC<DividerProps> = ({ customClassName, className, ...restProps }) => {
  const { styles, cx } = useStyles();
  
  const dividerClassName = cx(
    className,
    customClassName,
    styles.divider
  );

  return <AntdDivider className={dividerClassName} {...restProps} />;
};

export { Divider };
export default Divider;

